<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>node name</title>
		<script>
		function getDiv(){
			var d=document.getElementById("d1");
			// for(let i=0;i<d.childNodes.length;i++){
			// 	let t=d.childNodes[i];
			// 	alert(i+"->"+t.nodeName+","+t.nodeValue+","+t.nodeType);
			// }
			for(let i=0;i<d.children.length;i++){
				let t=d.children[i];
				alert(i+"->"+t.nodeName+","+t.nodeValue+","+t.nodeType);
			}
		}
		</script>
	</head>
	<body>
		<div id="d1">
			<p>1</p>
			<p>2</p>
			<p>3</p>
			<h3>你好</h3>
			<p>5</p>
		</div>
		<button type="button" onclick="getDiv()">获得div</button>
	</body>
</html>
